<?php
namespace Components\Traits;

trait FactoryTraits {
  public function getFacade($key = null) {
    if(is_null($key)) {
      $className = $key = 'Facade';
    } else {
      $className = $key . '\\Facade';
      $key .= 'Facade';
    }

    return $this -> newClassName($key, $className, $this -> getParameter($key));
  }

  public function getService() {
    return $this -> newClassName('Service', 'Service', []);
  }
}
